package com.pratices.mvc.bean.vo;

import lombok.Data;

@Data
public class BaseRespVo<T> {
    private Integer errno;
    private String errmsg;
    private T data;
    //设置ok方法
    public static <T> BaseRespVo<T> ok(T data) {
        BaseRespVo<T> baseRespVo = new BaseRespVo<>();
        baseRespVo.setErrno(0);
        baseRespVo.setErrmsg("成功");
        baseRespVo.setData(data);
        return baseRespVo;
    }
    public static <T> BaseRespVo<T> authFail(T data){
        BaseRespVo<T> baseRespVo = new BaseRespVo<>();
        baseRespVo.setErrno(603);
        baseRespVo.setErrmsg("认证失败");
        return baseRespVo;
    }
    public static <T> BaseRespVo<T> loginFirst(){
        BaseRespVo<T> baseRespVo = new BaseRespVo<>();
        baseRespVo.setErrno(601);
        baseRespVo.setErrmsg("请先登录");
        return baseRespVo;
    }
}
